package com.evil.common.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotNull;


/**
 * @author 阿巳
 */
@ConfigurationProperties(prefix = "evil.thread.pool")
@Data
@Validated
@Configuration
public class ThreadPoolProperties {

    /**
     * 执行并行任务时，等待多久时间超时 不能为空
     */
    @NotNull
    private Integer timeOut;

    /**
     * 队列大小
     */
    @NotNull
    private Integer queueSize;

    /**
     * 核心线程大小
     */
    @NotNull
    private Integer coreThreadNum;

    /**
     * 线程池线程大小
     */
    @NotNull
    private Integer maxPoolSize;

    /**
     * 并行执行每组大小 默认20
     */
    private Integer groupSize = 20;
}
